<?php
if (!defined('_CAN_LOAD_FILES_'))
	exit;
?>
<link rel="stylesheet" href="<?php echo __PS_BASE_URI__."modules/".$this->name."/assets/admin/form.css";?>" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="<?php echo __PS_BASE_URI__."modules/".$this->name."/assets/admin/farbtastic/farbtastic.css";?>" type="text/css" media="screen" charset="utf-8" />
<script type="text/javascript" src="<?php echo __PS_BASE_URI__."modules/".$this->name."/assets/admin/farbtastic/farbtastic.js";?>"></script>
<script type="text/javascript" src="<?php echo __PS_BASE_URI__."modules/".$this->name."/assets/admin/form.js";?>"></script>
<script type="text/javascript">
$(document).ready(function() {   	            
    //When page loads...
    $(".tab_content").hide(); //Hide all content
    $("ul.tabs li:first").addClass("active").show(); //Activate first tab
    $(".tab_content:first").show(); //Show first tab content
    
    //On Click Event
    $("ul.tabs li").click(function() {
    
    	$("ul.tabs li").removeClass("active"); //Remove any "active" class
    	$(this).addClass("active"); //Add "active" class to selected tab
    	$(".tab_content").hide(); //Hide all tab content
    
    	var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content        
    	$(activeTab).fadeIn(); //Fade in the active ID content
    	return false;
    });     
  });
</script>
<script type="text/javascript">
    jQuery(document).ready(function($) {    
   	jQuery('.it-addrow-block .add').each( function( idx , item ){    	  
        jQuery(item).bind('click',function(e){
			var name        = $(item).attr('id').replace('btna-','');            
            var div         = $('<div class="row"></div>');
            var spantext    = $('<span class="spantext"></span>');
            var span        = $('<span class="remove"></span>');
            var input       = $('<input type="text" name="'+name+'[]" value=""/>');
			var parent = $(item).parent().parent();
            div.append(spantext);
            div.append(input);
            div.append(span);
            parent.append(div);
            number = parent.find('input').length;                  
            spantext.html(parent.find('input').length);			
			span.bind('click',function(){ 
				if( span.parent().find('input').value ) {
					if( confirm('Are you sure to remove this') ) {
						span.parent().remove(); 
					}
				} else {
					span.parent().remove(); 
				}				
			} );				 			
        });
	});
	jQuery('.it-addrow-block .remove').bind('click',function(events){	    
	    parent = $(this).parent();        
		if( parent.find('input').value ) {
			if( confirm('Are you sure to remove this') ) {
				parent.remove();
			}
		}else {
			parent.remove();
		}		
	});      
  });
</script>
<?php  
    $yesNoLang = array("0"=>$this->l('No'),"1"=>$this->l('Yes')); 
    $fileLangArr = array(
                    "is_ena"        => $this->l('Is Enabled'),
                    "global_set"    => $this->l('Content'),
                    "title"         => $this->l('Title'),                    
                    "link"          => $this->l('Link'),
                    "content"       => $this->l('Content'),
                    "path_img"      => $this->l('Image'),
                    "classicon"     => $this->l('Type of Icon'),
                    "price"         => $this->l('Price'),
                    "desc"          => $this->l('Description')
                    );
    $languages = Language::getLanguages(true);
    $lang = array();
    $lang['auto'] = 'Auto Language';
    foreach($languages AS $language){
    	$lang[$language['id_lang']] = $language['name'];	
    }
?>
<h3><?php echo $this->l('Lof Slidorion Configuration');?></h3>
<form action="<?php echo $_SERVER['REQUEST_URI'].'&rand='.rand();?>" enctype="multipart/form-data" method="post" id="lofform">
 <input type="submit" name="submit" value="<?php echo $this->l('Update');?>" class="button" />
  <fieldset>
    <legend class="lof-legend"><img src="../img/admin/contact.gif" /><?php echo $this->l('Global Setting'); ?></legend>
    <div class="lof_config_wrrapper clearfix">
      <ul>
        <?php 
            $optionsTheme = array(
                'basic'=>$this->l('Basic')
            );
            echo $this->_params->selectTag("module_theme",$optionsTheme,$this->getParamValue("module_theme","basic"),$this->l('Theme - Layout'),'class="inputbox"', 'class="row" title="'.$this->l('Select a theme').'"');       
            echo $this->_params->selectTag("module_group",$groups,$this->getParamValue("module_group",'product'),$this->l('Select Group'),'class="inputbox select-group"', 'class="row" title="'.$this->l('Select a group').'"');
        ?>      	                   	        
        <li class="row module_group-product">
            <?php 
               echo $this->_params->lofGroupTag($this->l('Group Product'),"lof-group");               
               $homeSorceArr = array("selectcat"=>$this->l('Select category'),"productids"=>$this->l('Product IDs')); 
               echo $this->_params->selectTag("home_sorce",$homeSorceArr,$this->getParamValue("home_sorce","selectcat"),$this->l('Get Product From'),'class="inputbox select-group"','','class="row"');               
               echo $this->_params->getCategory("category[]",$this->getParamValue("category",""),$this->l('Select category'),'size="10" multiple="multiple" style="width: 90%;" class="inputbox"','','class="row home_sorce-selectcat"','',$this->l('All Categories'));
               $arrOder = array('p.date_add'=>$this->l('Date Add'),'p.date_add DESC'=>$this->l('Date Add DESC'),
                                'name'=>$this->l('Name'),'name DESC'=>$this->l('Name DESC'),
                                'quantity'=>$this->l('Quantity'),'quantity DESC'=>$this->l('Quantity DESC'),
                                'p.price'=>$this->l('Price'),'p.price DESC'=>$this->l('Price DESC'));
               echo $this->_params->selectTag("order_by",$arrOder,$this->getParamValue("order_by","p.date_add"),$this->l('Order By'),'class="inputbox select-group"','','class="row home_sorce-selectcat"');
               
               $trueFalse = array(
                    'true' => $this->l('Yes'),
                    'false' => $this->l('No')
               );
  
               echo $this->_params->radioBooleanTag("autoPlay", $trueFalse,$this->getParamValue("autoPlay",true),$this->l('Auto Play'),'class="select-option"','class="row"','','');
               echo $this->_params->inputTag("productids",$this->getParamValue("productids","1,2,3,4,5"),$this->l('Product IDs'),'class="text_area"','class="home_sorce-productids"','');
              
               echo $this->_params->inputTag("limit_items",$this->getParamValue("limit_items",5),$this->l('Limit items'),'class="text_area"','class="row"','');
               echo $this->_params->inputTag("md_height",$this->getParamValue("md_height",385),$this->l('Module Height'),'class="text_area"','class="row"','');
               echo $this->_params->inputTag("md_width",$this->getParamValue("md_width",760),$this->l('Module Width'),'class="text_area"','class="row"','');
               echo $this->_params->inputTag("itemAtv",$this->getParamValue("itemAtv",1),$this->l('Item First Active'),'class="text_area"','class="row"','');
               ?>
          </li>
                       
      </ul>
    </div>
  </fieldset>
  <fieldset class="lof-fieldset">
    <legend class="lof-legend"><img src="../img/admin/contact.gif" /><?php echo $this->l('Images Setting'); ?></legend>
    <div class="lof_config_wrrapper clearfix">
      <ul>
        <?php 
            echo $this->_params->radioBooleanTag("cre_main_size", $yesNoLang, $this->getParamValue("cre_main_size",1),$this->l('Create Size of Main Image'),'class="select-option"','class="row"','',$this->l('You can create a new size or use available size.'));
            $mainImgSize = array();
            //echo "<pre>";print_r($formats);die;
            foreach ($formats as $k=> $format):
                $mainImgSize[$format['name']] = $format['name'].'('.$format['width']."x".$format['height'].')';
            endforeach;
            echo $this->_params->selectTag("main_img_size",$mainImgSize,$this->getParamValue("main_img_size","thickbox"),$this->l('Main Image Size'),'class="inputbox select-group"','class="row cre_main_size-0"','',$this->l('You can create a new size via Menu <b>Preferences/Image</b>.'));
            echo $this->_params->inputTag("main_height",$this->getParamValue("main_height",385),$this->l('Main Image Height'),'class="text_area"','class="row cre_main_size-1"','');
            echo $this->_params->inputTag("main_width",$this->getParamValue("main_width",500),$this->l('Main Image Width'),'class="text_area"','class="row cre_main_size-1"','');
            echo $this->_params->radioBooleanTag("linkImage", $yesNoLang,$this->getParamValue("linkImage",1),$this->l('Link for Image'),'class="select-option"','class="row"','','');
        ?>
      </ul>
    </div>
  </fieldset>
  <fieldset>
    <legend class="lof-legend"><img src="../img/admin/contact.gif" /><?php echo $this->l('Main Slider Setting'); ?></legend>
    <div class="lof_config_wrrapper clearfix">
      <ul>
        <?php 
            $options = array(
                '_blank'=>$this->l('New Window'),
                '_self'=>$this->l('Same Window')
            );
            echo $this->_params->radioBooleanTag("shadow_box", $yesNoLang,$this->getParamValue("shadow_box",1),$this->l('Enable Shadow Box'),'class="select-option"','class="row"','','');
            echo $this->_params->selectTag("target",$options,$this->getParamValue("target","_self"),$this->l('Open Link'),'class="inputbox"','class="row"','','');
            echo $this->_params->inputTag("des_max_chars",$this->getParamValue("des_max_chars",280),$this->l('Description Max Chars'),'class="text_area"','class="row cre_main_size-1"','');
            echo $this->_params->inputTag("subtitle_max",$this->getParamValue("subtitle_max",12),$this->l('Sub Title Max Chars'),'class="text_area"','class="row"','');
           
            echo $this->_params->radioBooleanTag("show_price", $yesNoLang,$this->getParamValue("show_price",1),$this->l('Enable Main Price'),'class="select-option"','class="row"','','');
            echo $this->_params->radioBooleanTag("priceReduction", $yesNoLang,$this->getParamValue("priceReduction",1),$this->l('Enable Price Without Reduction'),'class="select-option"','class="row"','','');
            echo $this->_params->radioBooleanTag("show_read", $yesNoLang,$this->getParamValue("show_read",1),$this->l('Enable View Text'),'class="select-option"','class="row"','','');
            echo $this->_params->radioBooleanTag("show_date", $yesNoLang,$this->getParamValue("show_date",1),$this->l('Enable Date'),'class="select-option"','class="row"','','');
            echo $this->_params->radioBooleanTag("add_cart", $yesNoLang,$this->getParamValue("add_cart",1),$this->l('Enable Add to Cart'),'class="select-option"','class="row"','','');
            ?>
      </ul>
    </div>
  </fieldset>
 <fieldset class="lof-fieldset">
    <legend class="lof-legend"><img src="../img/admin/contact.gif" /><?php echo $this->l('Effect Setting'); ?></legend>
    <div class="lof_config_wrrapper clearfix">
      <ul>
        <?php
            $options = array(
                'none'        =>$this->l('None'),
                'fade'        =>$this->l('Fade'),
                'slideLeft'       =>$this->l('slideLeft'),
                'slideRight'     =>$this->l('slideRight'),
                'slideUp'       =>$this->l('slideUp'),
                'slideDown'      =>$this->l('slideDown'),
                'overLeft'    =>$this->l('overLeft'),
                'overRight'       =>$this->l('overRight'),
                'overUp'      =>$this->l('overUp'),
                'overDown'    =>$this->l('overDown')
            ); 
            echo $this->_params->selectTag("lofeffect",$options,$this->getParamValue("lofeffect","fade"),$this->l('Slider Effect'),'class="inputbox"','class="row"','','');
            echo $this->_params->inputTag("lof_speed",$this->getParamValue("lof_speed",800),$this->l('Slidorion Speed'),'class="text_area"','class="row cre_main_size-1"','');
            echo $this->_params->inputTag("lof_duration",$this->getParamValue("lof_duration",3500),$this->l('Slidorion Duration'),'class="text_area"','class="row cre_main_size-1"','');
            echo $this->_params->radioBooleanTag("hoverPause", $trueFalse,$this->getParamValue("hoverPause",1),$this->l('Hover Pause'),'class="select-option"','class="row"','','');
        ?>
      </ul>
    </div>
  </fieldset>
<br />
  <input type="submit" name="submit" value="<?php echo $this->l('Update');?>" class="button" />
  	<fieldset><legend class="lof-legend"><img src="../img/admin/comment.gif" alt="" title="" /><?php echo $this->l('Information');?></legend>    	
    	<ul>
    	     <li>+ <a target="_blank" href="http://landofcoder.com/prestashop/lof-slidorion.html"><?php echo $this->l('Detail Information');?></li>
             <li>+ <a target="_blank" href="http://landofcoder.com/supports/forum.html?id=88"><?php echo $this->l('Forum support');?></a></li>
             <li>+ <a target="_blank" href="http://www.landofcoder.com/submit-request.html"><?php echo $this->l('Customization/Technical Support Via Email');?>.</a></li>             
        </ul>
        <br />
        @Copyright: <a href="http://wwww.landofcoder.com">LandOfCoder.com</a>
    </fieldset>
</form>